package com.example.rtmppush;


// 数据包
public class RTMPPacket {

    //帧数据
    private byte[] buffer;

    //时间戳
    private long tms;

    // 包类型
    private int type;


    public  static  final  int PACKET_AUDIO_TYPE = 0;
    public  static  final  int PACKET_VIDEO_TYPE = 1;


    public RTMPPacket(byte[] buffer, long tms) {
        this.buffer = buffer;
        this.tms = tms;
    }

    public int getLength() {
        if (buffer!=null) {
            return buffer.length;
        }
        return 0;
    }

    public byte[] getBuffer() {
        return buffer;
    }

    public void setBuffer(byte[] buffer) {
        this.buffer = buffer;
    }

    public long getTms() {
        return tms;
    }

    public void setTms(long tms) {
        this.tms = tms;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
}
